<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>VUE实例洗牌</title>
        <script crossorigin="anonymous" integrity="sha384-9u9lzb/hr8e14GLHe5TEOrTiH3Qtw5DX2Zw9X/g7cqj81W2McEMx5CKOszxdb8jg" src="https://lib.baomitu.com/vue/2.6.10/vue.js"></script>
    </head>
    <body>
      <div id="app">
      <input type="text" v-model="mytext">
      <ul>
      <li v-for="data in datalistcom" :key="data">
      {{ data }}
      </li>
      </ul>
      </div>
      </body>
      <script>
      var vm = new Vue({
        el: "#app",
        data:{
          datalist:["aaa","bbb","ccc","ddd","aa","a","cc","dd"],
          mytext:''
        },
      computed:{
        datalistcom () {
          return this.datalist.filter(item=>item.indexOf(this.mytext)>-1)
        }
      }
      })
      </script>
</html>